package cn.tedu.poresonnel.controller;

import cn.tedu.common.vo.JsonResult;
import cn.tedu.poresonnel.pojo.param.PoresonnelParam;
import cn.tedu.poresonnel.pojo.vo.PoresonnelVO;
import cn.tedu.poresonnel.service.PoresonnelService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;



@Slf4j
@RestController
@RequestMapping("/ry")
@Api(tags = "人员管理")
public class PoresonnelCoenoller {
    @Autowired
     PoresonnelService poresonnelService;

    @GetMapping("/poresonnel/queries")
    @ApiOperation(value = "查询人员信息")
    public JsonResult queryporesonnel( PoresonnelParam poresonnelParam){
        log.debug("查询人员信息，id={},password={}",poresonnelParam);
        List<PoresonnelVO> list = poresonnelService.queryporesonnel(poresonnelParam);
        return JsonResult.ok(list);
    }

    @PostMapping("/poresonnel/add")
    @ApiOperation(value = "添加人员信息")
    public JsonResult addporesonnel( PoresonnelVO poersonnelVO){
        log.debug("添加人员信息，id={},password={}",poersonnelVO);
        poresonnelService.addporesonnel(poersonnelVO);
        return JsonResult.ok("添加成功");
    }
}
